#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=998244353;
int x,y;
map <int,int> mp;
int calc(int now){
	if(mp.find(now)!=mp.end())return mp[now];
	if(now==x)return 1;
	if(now/2ll<x){//
		if(now<x)return 0;
		return mp[now]=1;
	}
	int tmp=calc(now-1);
	if(now%2ll==0)tmp=(tmp+calc(now/2ll))%mod;
	return mp[now]=tmp;
}
signed main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin >> x >> y;
	if(max(x,y)<=100000)cout << calc(y);	
	return 0;
}


